﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace KinectPG.LibraryTestGame
{
    class PlayerActionLimb : GameObject
    {
        private GraphicsDevice graphics;

        public Rectangle GetObjectBoundingBox
        {
            get
            {
                return new Rectangle((int)this.Position.X - (int)(this.objectTexture.Width * this.Scale / 2), (int)this.Position.Y - (int)(this.objectTexture.Width * this.Scale / 2), (int)(this.objectTexture.Width * this.Scale), (int)(this.objectTexture.Height * this.Scale));
            }
        }

        public PlayerActionLimb(SpriteBatch sb, GraphicsDevice graphics, Texture2D texture, float? scale) 
            : base(sb)
        {
            this.graphics = graphics;
            this.objectTexture = texture;
            if (scale.HasValue)
                this.Scale = scale.Value;
        }

        public override void Draw(GameTime gameTime)
        {
            if(this.SpriteBatch != null)
                SpriteBatch.Draw(this.objectTexture, new Rectangle((int)this.Position.X - (int)(this.objectTexture.Width * this.Scale / 2), (int)this.Position.Y - this.objectTexture.Height / 2, (int)(this.objectTexture.Width * this.Scale), (int)(this.objectTexture.Height * this.Scale)), Color.White);
        }
    }
}
